#{extends 'magicBox.html' /}
#{set 'title'}Sprint ${sprint.sprintNumber}#{drop 'sprint-' + sprint.id /}
#{if connected.in(sprint.project).can("editSprint")}
#{if sprint.ended}
<img class="dim"src="/pubilc/images/famfam/pencil.png" />
#{/if}
#{else}
<a href="#" onclick="overlayOpen('@{Sprints.projectshow(sprint.id)}')"><img src="/public/images/famfam/pencil.png" /></a>
#{/else}
#{/if}

<!-- countdown -->
	#{if sprint.startDate.after(new Date())}
	<span id="sppt_${sprint.id}" class="meeting_countdown"></span>
		<script type="text/javascript">
		$(function() {
			showDate(${sprint.id},'sppt_'+${sprint.id},${sprint.startDate.getTime()},"sprint ${sprint.sprintNumber}","sprint");
		})
		</script>	
	#{/if}
<!-- end countdown -->


#{/set}
<script type="text/javascript">
function isBefore(date){
	var now=new Date();
	var other=new Date(date);
	if(now<other){
	return  true;
		}
	else{
	return false;
		}
}</script>
#{if (running)} 
<div style="margin-top: 20px; padding: 0pt 0.7em;" class="ui-state-highlight ui-corner-all"> 
					<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span>
					<strong>The sprint is currently running</strong></p>
				</div>

#{/if}

<strong>Sprint Number:</strong> ${sprint.sprintNumber}
<br />
<strong>Project:</strong> ${proj.name}
<br />
<strong>Start Date: </strong>${sprint.format(sprint.startDate)}
<br />
<strong>End Date:</strong> ${sprint.format(sprint.endDate)}
<br />
		

#{if sprint.project.hasComponents()>1}
	<div name="@{Sprints.backlogs(sprint.id)}">Backlogs
	<a href="#" onclick="overlayOpen('@{SprintBacklog.index(0,sprint.id)}')" title="View backlog for all components?">
	<img src="@{'public/images/famfam/table.png'}" alt="[chart]"/></a></div>
	
	<div name="@{Sprints.charts(sprint.id)}">Charts
	<a href="#" onclick="overlayOpen('@{SprintBacklog.show_graph(sprint.id,0)}')" title="view the burndown chart?">
	<img src="@{'public/images/famfam/chart.png'}" alt="[chart]"/></a></div>
	
	<div name="@{Boards.sprintBoards(sprint.id)}">Boards
	#{if sprint.ended || sprint.ended()}
		
	#{/if}
	#{else}
		<a href="#" onclick="overlayOpen('@{Boards.loadboard1(sprint.id)}')" title="View project board?">
		<img src="@{'public/images/famfam/application_view_tile.png'}" alt="[board]"/></a>
	#{/else}
	</div>
#{/if}
#{else}
<div class="overlay"name="@{SprintBacklog.index(0,sprint.id)}">Backlog
			<a href="#" onclick="overlayOpen('@{SprintBacklog.index(0,sprint.id)}')" title="View backlog for all components?">
<img src="@{'public/images/famfam/table.png'}" alt="[chart]"/></a></div>

<div class="overlay"name="@{SprintBacklog.show_graph(sprint.id,0)}">Chart
<a href="#" onclick="overlayOpen('@{SprintBacklog.show_graph(sprint.id,0)}')" title="view the burndown chart?">
<img src="@{'public/images/famfam/chart.png'}" alt="[chart]"/></a></div>

	#{if sprint.ended || sprint.ended()}
		
	#{/if}
	#{else}
		<div class="overlay" name="@{Boards.loadboard1(sprint.id,sprint.project.components[0].id)}">Boards
		<a href="#" onclick="overlayOpen('@{Boards.loadboard1(sprint.id,sprint.project.components[0].id)}')" title="View project board?">
		<img src="@{'public/images/famfam/application_view_tile.png'}"/></a>
	#{/else}
</div>
#{/else}

